<?php
header("Content-Type: application/json; charset=UTF-8");
include_once 'service.php';
$service = new Dcservice();

$json = json_decode(file_get_contents("php://input"));

$result = ["code" => 0, "msg" => "添加成功！"];
try {
    $service->addboard($json->boardName);
} catch (Error $error) {
    $result = ["code" => -1, "msg" => $error->getMessage()];
}

echo json_encode($result);

